<html>
<head>
<title>协同办公平台-用户登录</title>
	
<#include "/common/header.html"/>

<link rel="stylesheet" type="text/css" href="${ctx}/css/login/style.css"/>
<script type="text/javascript" src="${ctx}/js/login/cloud.js" ></script>

<script language="javascript">
	$(function(){
		
	    $('.loginbox').css({'position':'absolute','left':($(window).width()-692)/2});
		$(window).resize(function(){  
	    $('.loginbox').css({'position':'absolute','left':($(window).width()-692)/2});
	    }) 
	    
	    /** 为表单绑定onsubmit提交事件 */
		$("#loginBtn").click(function(){
			/** 做表单输入校验 */
			var userId = $("#userName");
			var pwd = $("#userPassword");
			var tip = "";
			if ($.trim(userId.val()) == ""){
				tip = "登录用户名不能为空！";
				userId.focus();// 调用文本框获取焦点方法
			}else if ($.trim(pwd.val()) == ""){
				tip = "登录密码不能为空！";
				pwd.focus();// 调用文本框获取焦点方法
			}else if (!/^\w{6,20}$/.test($.trim(pwd.val()))){
				tip = "登录密码格式不正确！";
				pwd.focus();// 调用文本框获取焦点方法
			}
			/** 判断表单是否通过校验 */
			if (tip != ""){
				var d = dialog({
					title: '温馨提示',
				    content: '<font size=8 color=red>'+tip+'</font>'
				});
				d.show();
				setTimeout(function () {
				    d.close().remove();
				}, 2000);
				return false;
			}else{
				$("#login").submit();
			}
		});
		
		/** 绑定回车键绑定事件，当用户按了回车键，就提交表单 */
		$(document).keydown(function(event){
			if (event.keyCode === 13){ // 等于13代表按了回车键
				// 触发表单提交按钮的点击事件
				$("#loginBtn").trigger("click");
			}
		});
	});
	
</script> 

</head>

<body style="background-color:#1c77ac; background-image:url(${ctx}/images/login/light.png); background-repeat:no-repeat; background-position:center top; overflow:hidden;">
    <div id="mainBody">
      <div id="cloud1" class="cloud"></div>
      <div id="cloud2" class="cloud"></div>
    </div>  
<div class="logintop">    
    <span>欢迎登录协同办公平台</span>    
    <ul>
    <li><a href="#">回首页</a></li>
    <li><a href="#">帮助</a></li>
    <li><a href="#">关于</a></li>
    </ul>    
    </div>
    
    <div class="loginbody">
    
    <span class="systemlogo"></span>
    
    <div class="loginbox">
    <form id="login" action="${ctx}/user/login" method="POST">
    <ul>
    <li>
    <input id="userName" name="userName" type="text" class="loginuser" value="admin"/>
    </li>
    <li><input id="userPassword" name="userPassword" type="password" class="loginpwd" value="123456"/></li>
    <li><input name="" id="loginBtn" type="button" class="loginbtn" value="登录" />
    <label>
    	<input name="" type="checkbox" value="" checked="checked" />记住密码
    	<a href="#">忘记密码？</a>
    </label>
    </li>
    <li>
     <label>您还没有帐号？<a href="toRegister">立即注册</a></label>
	 </li>
    </ul>
    </form>
    </div>
    </div>
    <div id="footer" class="loginbm">
		 <span>版权所有  2015&nbsp;创新企业协同办公平台&nbsp;</span>
	</div>
</body>
</html>